package xiaohongshu.com.sunny.t2;

import java.util.Scanner;

/*import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        Node[] dp = new Node[n+5];

        dp[1] = new Node(0,0,0);
        dp[2] = new Node(1,0,0);
        for(int i=3;i<=n;i++){
            Node tmp = getNode(i);
            long tmpNum2 = 0;
            long tmpNum5 = 0;
            long tmpTail0 = 0;
            if(tmp.num2>0 && dp[i-1].num5>0){
                if(tmp.num2 >= dp[i-1].num5){
                    tmpNum2 = tmp.num2 - dp[i-1].num5;
                    tmpTail0 += dp[i-1].num5;
                }else{
                    tmpNum5 = dp[i-1].num5 - tmp.num2;
                    tmpTail0 += tmp.num2;
                }
            }else if(tmp.num5>0 && dp[i-1].num2 > 0){
                if(tmp.num5 >= dp[i-1].num2){
                    tmpNum5 = tmp.num5 - dp[i-1].num2;
                    tmpTail0 += dp[i-1].num2;
                }else{
                    tmpNum2 = dp[i-1].num2 - tmp.num5;
                    tmpTail0 += tmp.num5;
                }
            }else {
                tmpNum2 = tmp.num2 + dp[i - 1].num2;
                tmpNum5 = tmp.num5 + dp[i - 1].num5;
            }
            tmpTail0 += tmp.tail0 + dp[i-1].tail0;
            dp[i] = new Node(tmpNum2, tmpNum5, tmpTail0);
//            System.out.println(i+" "+dp[i]);
        }
        int res = 0;
        for(int i=1;i<=n;i++){
            res += dp[i].tail0;
        }
        System.out.println(res);
    }

    public static Node getNode(int n){
        int tail0 = 0;
        int tmp = n;
        while (tmp%10 == 0){
            tmp /= 10;
            tail0++;
        }
        int num2 = 0;
        while ((tmp&1) == 0){
            tmp >>= 1;
            num2++;
        }
        int num5 = 0;
        while ((tmp%5) == 0){
            tmp /= 5;
            num5++;
        }
        return new Node(num2, num5, tail0);
    }

}

class Node{
    long num2;
    long num5;
    long tail0;

    public Node(long num2, long num5, long tail0) {
        this.num2 = num2;
        this.num5 = num5;
        this.tail0 = tail0;
    }

    @Override
    public String toString() {
        return "Node{" +
                "num2=" + num2 +
                ", num5=" + num5 +
                ", tail0=" + tail0 +
                '}';
    }
}
*/
public class Main{
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        long prev = 0;
        long jiechen = 0;
        for(int i=1;i<=n;i++){
//            System.out.print("i="+i+" ");
//            System.out.print(judge(i)+" ");
            jiechen = jiechen + judge(i);
            prev = prev + jiechen;
//            System.out.println(prev);
        }

        System.out.println(prev);

    }

    public static long judge(int n){
        long res = 0;
        int tmp = n;
        while (tmp%10 == 0){
            tmp /= 10;
            res++;
        }
        while ((tmp%5) == 0){
            tmp /= 5;
            res++;
        }
        return res;
    }
}